#include <iostream>
using namespace std;

class Count{
	friend void setX(Count &, int);
	public:
		Count():x(0)
		{
		}
		void print() const
		{
			cout << x << endl;
		}
	private:
		int x;
	 
};
void setX(Count &c, int val)
{
	c.x = val;
}

//void cannotSetx(Count &c, int val)
//{ 
//	c.x = val;
//}
int main(int argc, char** argv) {
	Count counter;
	
	cout << "counter.x = ";
	counter.print();
	
	setX(counter, 8);
	cout << "conter.x = ";
	counter.print();
	
	cannotSetx(counter, 10);
	return 0;
}
